﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplication.UserControls
{
    public partial class Header : System.Web.UI.UserControl
    {
        public static int intSaveSearch = 0;
        public static int intSaveListing = 0;
        public static int intviewedListing = 0;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["UserID"].ToString() != "Guest")
            {
                btnSignout.Visible = true;
                lnkSignIn.Visible = false;
            }
            else
            {
                lnkSignIn.Visible = true;
            }
            
            
        }
        public void btnSignout_Click(object sender, EventArgs e)
        {
            Session.Clear();
            Session.Abandon();
            Session["UserID"] = "Guest";
            Response.Redirect("~/default.aspx");
        }
        public void lnkSignIn_Click(object sender, EventArgs e)
        {
            Response.Redirect("Sign-In.aspx?return_to="+ HttpContext.Current.Request.UrlReferrer.PathAndQuery.Replace('&','@'));
        }
        
    }
}